 var id = getvl("id");
 
   $(function(){
   	   if(id!=''){
   	   	$("#zhifus").attr("href","../12.0.0zhifu_goods.html?orid="+id); 
   	   	  dingdandaifukaun(id);
   	   }else{
   	   //	alert(".....失败");
   	   }
   });
function dingdandaifukaun(){	
	$("#shijian").val("");
     $.ajax({
			url: urlcore + "/api/order/selectOne2?id="+id,
			type: "get",
			dataType: 'json',
			contentType: "application/json;charset=utf-8",
			success:function(data){
				if(data.success == true) {
			var dizhis=data.data.address.province+data.data.address.city+data.data.address.county+data.data.address.address;
			var dizhi=' <ul class="clearfix" style="width: 100%;"> '+
'<li><span>收&nbsp;&nbsp;货&nbsp;&nbsp;人</span>'+data.data.address.userName+'</li>'+
'        <li class="a_xiugai_right">'+
'            <span>电&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;话</span>'+data.data.address.userPhone+''+
'        </li>'+
'        <li><span>收货地址</span>'+dizhis+'</li>'+
'    </ul>';	
			   $("#dizhi").append(dizhi);//地址		
	   $("#shopnaem").html(data.data.shop.storeName);
	   var	leirong="";
			 $.each(data.data.goodsCarList,function(m,q){
			 leirong+='<div class="clearfix tuwen">'+
'    	<a href="../7.0.0goods_detail.html?id='+q.goods.id+'">'+
'	        <div class="tuwen-img fl">'+
'	            <img onerror="errorImg2(this)" src="'+q.goods.coverUrl+'" width="75" height="75">'+
'	        </div>'+
'	        <div class="tuwen-wenzi">'+
'	            <h5 class="wuye_h01">'+q.goods.goodsTitle+'</h5>'+
'	            <div class="wuye_div01">产品质量均有保障</div>'+
'	        </div>'+
'        </a>'+
'    </div>';
		 $.each(q.myStockList,function(y,n){
			leirong += ' <div class="dingdan_fenlei clearfix">' +
 								'    	<ul class="fl">' +
 								'    		<li>颜色：<span>'+n.colour.colourName+'</span></li>'+
'    		<li>尺码：<span>'+n.size.sizeName+'</span></li>'+
'    		<li>单价：<span>'+q.packRate+'元/件</span></li>'+'    	</ul>' +
 								'    	<div class="fr">' +
 								'    		<h5>' + ((q.packRate*n.saleNum).toFixed(2))+ '元</h5>' +
 								'    		<h6>' + n.saleNum + '件</h6>' +
 								'    	</div>' +
 								'    </div>';
			 });
			 });
			 //alert(data.data.remark);
			  if(data.data.remark!=null&&data.data.remark!=""&&data.data.remark!="null"){
			   $("#liuyan").html(data.data.remark);
			  }
			  $("#shangshuliang").html(data.data.goodsNumber);
			
			   $("#heji").html("&yen;"+data.data.orderMoney);
			    var peisong="";
			    if(data.data.giveType==1){
			    	peisong="包邮";
			    }else if(data.data.giveType==2){
			    	peisong="快递";
			    }else if(data.data.giveType==3){
			    	peisong="物流到付";
			    }
			   $("#peisong").html(peisong);
			   
		var feiyongmingxi='<li>商品总金额<span>&yen;'+data.data.orderMoney+'</span></li>'+
'        <li>总运费<span>+&yen;'+data.data.freightMoney+'</span></li>'+
'        <li>优惠券<span>-&yen;'+data.data.saveMoney+'</span></li>'+
'        <li>金币抵扣<span>-&yen;'+data.data.goldMoney+'</span></li>';
    var fangshi="";
           if(data.data.payType==1){
           	  fangshi="余额支付";
           }else if(data.data.payType==2){
           	 fangshi="支付宝支付";
           }else if(data.data.payType==3){
           	fangshi="微信支付";
           }else if(data.data.payType==4){
           	fangshi="银联支付";
           }
          $("#shifu").html("&yen;"+data.data.payMoney)
       var gatetime = new Date(data.data.payTime).pattern("yyyy-MM-dd hh:mm:ss");
 var dingdanxingxi='<li>订单编号<span>'+data.data.orderNumber+'</span></li>'+
 '        <li>付款时间<span>'+gatetime+'</span></li>'+
'        <li>创建时间<span>'+data.data.gmtDatetime+'</span></li>';
   $("#shifujine").html("&yen;"+data.data.payMoney);    
	$("#feiyongmingxi").append(feiyongmingxi);//费用信息
    $("#dingdanxingxi").append(dingdanxingxi);//费用信息
	$("#neirong").append(leirong);
	
	var dingdandaifahuo='    	<div class="fr">'+
'    		<span class="dingdan_tixing" id="oder'+data.data.id+'" onclick="tixingfahuo(this,'+data.data.id+')">提醒发货</span>'+
'    	</div>'+
'    	<div class="fr">'+
'    		<a href="12.9.2buy_dingdan_tuikuan_shenqing.html?id='+data.data.id+'" class="dingdan_footer_hui">申请退款</a>'+
'    	</div>';
	$(".buy_detail_footer_con").html(dingdandaifahuo);
	
			 }
			},
			error:function() {
				alert("error");
			}
		});
}
